/*
 * $Id: OnwatchTaskInfo.java,v 1.6 2009/07/10 21:26:50 navdeep_mahajan Exp $
 * 
 * Copyright (C) 2008 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.onwatch.pojo;

import java.io.File;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Vector;

import com.ge.healthcare.autosc.common.database.pojo.ActOnwatchTask;
import com.ge.healthcare.autosc.common.database.pojo.CfgOnwatchFileInfo;
import com.ge.healthcare.autosc.common.pojo.sysInfo.SystemInfo;
import com.ge.healthcare.autosc.onwatch.util.OnWatchCodeConstants;

public class OnwatchTaskInfo {

	private File commandFile = null;
	private String user = null;
	private String requestor = null;
	private List<CfgOnwatchFileInfo> putFiles = null;
	private List<CfgOnwatchFileInfo> getFiles = null;
	private ActOnwatchTask onwatchTask = null;
	private SystemInfo systemInfo = null;
	private boolean dynamicArg = false;
	private boolean debug = false;
	private Map<String, String> requestProperties = null;
	private String failReasonCode = OnWatchCodeConstants.PRC_F_OWR_020;
	private boolean prodiagsTask = false;
	private Hashtable<String, File> refCmdFiles = new Hashtable<String, File>();
	
	public OnwatchTaskInfo(SystemInfo systemInfo) {
		init();
		this.systemInfo = systemInfo;
	}
	
	public void init() {
		this.putFiles = new Vector<CfgOnwatchFileInfo>();
		this.getFiles = new Vector<CfgOnwatchFileInfo>();
	}
	
	public void setCommandFile(File commandFile) {
		this.commandFile = commandFile;
	}
	
	public File getCommandFile() {
		return commandFile;
	}
	
	public void addPutFile(CfgOnwatchFileInfo onwatchFileInfo) {
		this.putFiles.add(onwatchFileInfo);
	}
	
	public List<CfgOnwatchFileInfo> getPutFiles() {
		return putFiles;
	}
	
	public void addGetFile(CfgOnwatchFileInfo onwatchFileInfo) {
		this.getFiles.add(onwatchFileInfo);
	}
	
	public List<CfgOnwatchFileInfo> getGetFiles() {
		return getFiles;
	}
	
	public void setOnwatchTask(ActOnwatchTask onwatchTask) {
		this.onwatchTask = onwatchTask;
	}
	
	public ActOnwatchTask getOnwatchTask() {
		return onwatchTask;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public SystemInfo getSystemInfo() {
		return systemInfo;
	}

	public void setSystemInfo(SystemInfo systemInfo) {
		this.systemInfo = systemInfo;
	}

	public String getRequestor() {
		return requestor;
	}

	public void setRequestor(String requestor) {
		this.requestor = requestor;
	}
	
	public void markAsDynamicArg() {
		dynamicArg = true;
	}
	
	public boolean hasDynamicArg() {
		return dynamicArg;
	}

	public Map<String, String> getRequestProperties() {
		return requestProperties;
	}

	public void setRequestProperties(Map<String, String> requestProperties) {
		this.requestProperties = requestProperties;
	}

	public String getFailReasonCode() {
		return failReasonCode;
	}

	public void setFailReasonCode(String failReasonCode) {
		this.failReasonCode = failReasonCode;
	}
	
	public void markDebug() {
		this.debug = true;
	}
	
	public boolean isDebug() {
		return debug;
	}
	
	public void markProdiagsTask() {
		prodiagsTask = true;
	}
	
	public boolean isProdiagsTask() {
		return prodiagsTask;
	}
	
	public void addRefCmdFile(String name, File refFile) {
		refCmdFiles.put(name, refFile);
	}
	
	public File getRefCmdFile(String name) {
		return refCmdFiles.get(name);
	}
}
